<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>子代选择器</title>
    <style>
        ul>li {
            border-top: 5px solid red;
        }
        /* 后代 */
        ul li {
            color: purple;
        }
    </style>
</head>

<body>
    <ul>
        <li>Unordered item</li>
        <li>Unordered item
            <ol>
                <li>Item 1</li>
                <li>Item 2</li>
            </ol>
        </li>
    </ul>
</body>

</html>